1. Technical Field
The present invention relates to an image processing apparatus, a robot system, a robot, and an image processing method.
2. Related Art
Researches and developments of image processing for performing inspection and measurement of objects included in a picked-up image have been performed.
Concerning the image processing, there is known a method of selecting, in sequentially registering image processing commands and creating an image processing procedure, according to a type of an immediately preceding registered image processing command, an image processing command for displaying candidates of an image processing command that should be registered as the next procedure (see JP-A-07-28970 (Patent Literature 1)).
An image pickup apparatus (a camera) includes one or more lenses for focusing on a target object. There is an image pickup apparatus including a part (a focus ring) with which a user (a person) is capable of manually performing adjustment of focusing. For example, the user manually adjusts the focus ring of the image pickup apparatus while viewing a video (a live video) currently being picked up by the image pickup apparatus.
However, in such adjustment by the visual sense of the user, it is sometimes difficult to accurately adjust the focusing. For example, work for adjusting details of an image while viewing the details is sometimes difficult. Further, when focusing on a target object having depth, the user needs to adjust a diaphragm of the lenses together with the focus ring.
In order to assist the manual adjustment of the user, there is an image processing apparatus that displays an index value (a focus index value) representing a degree of the focusing. As the focus index value, for example, a statistical value of a luminance difference is used.
As an example, an image processing apparatus described in JP-A-2011-49980 (Patent Literature 2) calculates a focus value using an average of concentration values of colors of pixels included in an input image and a square average of the concentration values of the colors of the pixels included in the input image and outputs the calculated focus value (see paragraphs 0109 and 0110 of Patent Literature 2).
However, in the selection method described in Patent Literature 1, the candidates are displayed according to the immediately preceding registered image processing command. Therefore, even if the creation of the image processing procedure can be assisted, the user himself or herself has to select an image processing command necessary for performing desired inspection and measurement. Therefore, in an image processing apparatus having the selection method, it is sometimes difficult for the user to perform desired image processing unless the user has expert knowledge concerning image processing.
In Patent Literature 2, the focus value used in the past is a relative index. Accuracy of the focusing is sometimes insufficient. For example, since a luminance distribution changes according to contents of an image, elements unrelated to the focusing such as relatively bright or dark reflection of a target object affect each of images. Therefore, accuracy of focusing of the image is sometimes insufficient.
When only a region of interest of a target object of image processing is focused (a part of a picked-up image is focused), accuracy is sometimes insufficient. The same applies to a robot or a robot system including the image processing apparatus.